/*
* Copyright 2010 Pavel Kozhin 
*
* Licensed under the Apache License, Version 2.0 (the "License"); 
* you may not use this file except in compliance with the License. 
* You may obtain a copy of the License at 
* 
* http://www.apache.org/licenses/LICENSE-2.0
* 
* Unless required by applicable law or agreed to in writing, software 
* distributed  under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
* See the License for the specific language governing permissions and 
* limitations under the License.
*
* Author: Pavel Kozhin.
*/

package org.etherframework.core
{
	import flash.events.Event;
	import flash.system.ApplicationDomain;
	
	import mx.core.IUIComponent;
	import mx.managers.ISystemManager;
	
	import org.etherframework.core.util.ClassUtil;
	import org.etherframework.core.util.DataAccess;
	import org.etherframework.dependency.DependencyInfo;
	import org.etherframework.metadata.MetadataInfo;
	import org.etherframework.wire.WireInfo;

	public interface IBridge
	{
		function get systemManager():ISystemManager;
		
		function get host():IUIComponent;
		
		function get domain():ApplicationDomain;
		
		function get token():String;
		
		function get util():ClassUtil;
		
		function get shared():DataAccess;
		
		function get local():DataAccess;
		
		function get interaction():IBridgeInteraction;
		
		function listen(type:String, listener:Function, access:String = "local", domain:String = "single", 
						useCapture:Boolean = false, priority:int=0, useWeakReference:Boolean = false):void;
		
		function unlisten(type:String, listener:Function, access:String = "local", domain:String = "single", useCapture:Boolean = false):void;
		
		function dispatch(event:Event, access:String = "local", domain:String = "single"):Boolean;
		
		function getMetadata(value:Object):MetadataInfo;
		
		function addMetadata(value:Object):MetadataInfo;
		
		function removeMetadata(value:Object):MetadataInfo;
		
		function getBean(value:Object):DependencyInfo;
		
		function addBean(value:Object):DependencyInfo;
		
		function removeBean(value:Object):DependencyInfo;
		
		function getWire(value:Object):WireInfo;
		
		function addWire(value:Object):WireInfo;
		
		function removeWire(value:Object):WireInfo;
	}
}